<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>

<%@ page import="com.hline.kbcss.MyDriver"%>
<%String uname=(String)session.getAttribute("uname");
String userid=(String)session.getAttribute("userid");

%>

<%


String comment=request.getParameter("comment");
String aid=request.getParameter("aid");
PreparedStatement pst=null;
Statement st=null;

st=MyDriver.getConnection("READ"); 
pst=MyDriver.getPrepare("insert into comments values(null,?,?,?,?,?)");
    pst.setString(1,aid);
	pst.setString(2,userid);	
	pst.setInt(3,0);
	pst.setInt(4,0);
	pst.setString(5,comment);	
	int i=pst.executeUpdate();
	if(i>0)
	{
	response.sendRedirect("articles.jsp");
	}
	else
	{
		response.sendRedirect("artcomment.jsp?message=<font color=red>not added,please try again!!</font>");
	}
%>
